<template>
  <div>
    <a-card>
      <div class="text-xl font-bold mb-4">工时查询</div>
      <vxe-grid ref="xGrid" v-bind="gridOptions" v-on="gridEvent">
       <template #user="{ row }">
          {{ row.user.name }}
        </template>
        <template #repair="{ row }">
          {{ row.repair.order_no }}
        </template>
        <template #ticket="{ row }">
          {{ row.ticket.id }}
        </template>
        <template #service="{ row }">
          {{ row.ticket.services.map((i) => i.name).toString(",") }}
        </template>
        <template #kind="{ row }">
          {{ row.ticket.kind.union_name }}
        </template>
      </vxe-grid>
    </a-card>
  </div>
</template>

<script setup lang="ts">
const { gridOptions,userEmployee } = useRecord();
const xGrid = ref();
const gridEvent: VxeGridListeners<RowVO> = {
  proxyQuery() {
    console.log("数据代理查询事件");
    const grid = xGrid.value;
    //重新加载一下form搜索
    let item = grid.getFormItems(2)
    item.itemRender.props.options = userEmployee.value
  },
  proxyDelete() {
    console.log("数据代理删除事件");
  },
  proxySave() {
    console.log("数据代理保存事件");
  },
};
</script>

<style></style>
